var verification="";
var number="";
$(function(){
    $("#form").validate({
        rules: {
            number: {
                required: true,
                minlength: 11
            },
            number_d: {
                required: true,
                minlength:4
            }
        },
        message: {
            number: {
                required: true,
                minlength: "输入错误"
            },
            number_d: {
                required: true,
                minlength: "输入错误"
            }
        }
    });
    $('#number').blur(function(){
        $.ajax({
            type:"post",
            url:ar,
            dataType:"json",
            data:{
                number:$('#number').val()
            },
            success:function(msg){
                if(msg=="true"){
                    layer.open({
                        content:'手机号没有注册,请重新注册！！'
                    });
                }else{
                    verification=msg;
                    number=$('#number').val();
                }

            }
        })
    });
    $("#button").click(function(){
        $.ajax({
            type:"post",
            url:"http://106.ihuyi.com/webservice/sms.php?method=Submit&account=C88429033&password=e476ef653df3aec7e72519a49a7a0ece&mobile=" + number + "&content=您的验证码是：" + verification + "。请不要把验证码泄露给其他人。",
        })
    })
});
